<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header','Admin');
?>	
<form name="myform" action="<?php echo U('delete'); ?>" method="post">
<div class="pad_10">
	<div class="table-list">
		<table width="100%" cellspacing="0">
			<thead>
				<tr>
					<th width="30" align="center"><input type="checkbox" value="" id="check_box" onclick="selectall('id[]');"></th>
					<th>ID</th>
					<th align="center">任务标题</th>
					<th align="center">奖励U币</th>
					<th align="center">当前状态</th>
					<th align="center">创建时间</th>     
					<th>管理操作</th>
				</tr>
			</thead>
		<tbody>
		<?php foreach ($infos as $info): ?>
		<tr>
   			<td align="center"><input type="checkbox" name="id[]" value="<?php echo $info['id']?>"></td>
			<td align="center"><?php echo $info['id'];?><input type="hidden" name="userid" value="7"></td>
			<td align="center"><?php echo $info['title']?></td>
			<td align="center"><?php echo $info['do_coin'];?></td>       
			<td align="center"><?php echo ($infos['status']==1) ? '开启' : '关闭' ?></td> 
			<td align="center"><?php echo dgmdate($info['dateline']);?></td>        
			<td align="center">
				<a href="<?php echo U('edit', array('id' => $info['id'])) ?>">编辑</a> |
				<a href="<?php echo U('delete', array('id[]' => $info['id'], 'dosubmit' => true)) ?>">删除</a>
			</td>
		</tr>
		<?php endforeach; ?>
		</tbody>
	</table>
	<div class="btn"><label for="check_box"><?php echo L('selected_all')?>/<?php echo L('cancel')?></label>&nbsp;&nbsp;<input name="dosubmit" type="submit" class="button" value="批量删除" onClick="return confirm('<?php echo L('确定删除选定的记录？')?>')">&nbsp;&nbsp;</div>
    <div id="pages"><?php echo $pages ?></div>
</div>
</div>
</form>
</body>
</html>
<script type="text/javascript">
window.top.$('#display_center_id').css('display','none');
function edit(id, title) {
  window.top.art.dialog({id:'edit'}).close();
  window.top.art.dialog({title:'<?php echo L('cash_info')?>--'+title, id:'edit', iframe:'?m=Document&c=Cash&a=update&id='+id ,width:'500px',height:'250px'}, function(){var d = window.top.art.dialog({id:'edit'}).data.iframe;
  var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
}
function deletes(id){
  if(confirm("<?php echo L('affirm_delete')?>") == true){
	window.location.href = "?m=Document&c=Cash&a=delete&id="+id;
  }
}
</script>
